package org.skyeye.modeling.wizard;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

public class ExtractedTemplatesLabelContentProvider extends LabelProvider implements
		ITableLabelProvider{

	@Override
	public Image getColumnImage(Object element, int columnIndex) {
		return null;
	}

	@Override
	public String getColumnText(Object element, int columnIndex) {
	    if(element instanceof ExtractedTemplates){
	    	ExtractedTemplates templates = (ExtractedTemplates)element;
	    	switch (columnIndex) {
			case 0:
				return templates.getName();
			case 1:
				return templates.getDesc();
			default:
				return "";
			}
	    }
	    if(element == null){
	    	return "<null>";
	    }
	    try {
		    return element.toString();	
		} catch (Exception e) {
		    return e.toString();	
		}
	}

}
